#include "StatusCode.h"

using namespace std;

StatusCode::StatusCode(const bool& etat, const int& val, const int& code,
	     const std::string& message)
  : Etat( etat ), Valeur( val ), Code( code ), Message( message )
{}

StatusCode::StatusCode(const StatusCode& sc)
  : Etat( sc.Etat ), Valeur( sc.Valeur ), Code( sc.Code ),
    Message( sc.Message )
{}

StatusCode::~StatusCode()
{}

StatusCode::operator bool() const
{
  return Etat;
}

StatusCode::operator int() const
{
  return Valeur;
}

bool StatusCode::etat() const
{
  return Etat;
}

int StatusCode::valeur() const
{
  return Valeur;
}

int StatusCode::code() const
{
  return Code;
}

string StatusCode::message() const
{
  return Message;
}

ostream& operator<<(ostream& os, const StatusCode& sc)
{
  os << "Valeur : " << sc.valeur() << ", Code : " << sc.code() << ", "
     << sc.message();
  return os;
}
